// 登录相关
import Request from '../static/network/request.js';

export function login(data: {
		account: string
		password: string
		type: number
}):any {
	return Request.post({
		api:"/api/login",
		data
	})
}

export function register(data: {
		account: string
		password: string
		type: number
		code: string
		iso: string
}):any {
	return Request.post({
		api:"/api/register",
		data
	})
}

export function resetPassword(data: {
		account: string
		code: string
		password: string
		type: number
}):any {
	return Request.post({
		api:"/api/reset",
		data
	})
}

export function getUserinfo():any {
	return Request.get({
		api: "/api/userinfo"
	})
}

export function saveUserinfo(data:any):any {
	return Request.post({
		api: "/api/user/edit",
		data
	})
}

export function sendSms(data: {
	phone: string
	type: 1 | 2
}):any {
	return Request.post({
		api: "/api/register/verify",
		data
	})
}